package com.rnapp;


import android.Manifest;
import android.os.Bundle; // here

import com.facebook.react.ReactActivity;
import com.rnapp.runtimepermission.PermissionsManager;
import com.rnapp.runtimepermission.PermissionsResultAction;
// react-native-splash-screen >= 0.3.1
import org.devio.rn.splashscreen.SplashScreen; // here

// react-native-splash-screen < 0.3.1
// import com.cboy.rn.splashscreen.SplashScreen; // here

public class MainActivity extends ReactActivity {


    @Override
    protected void onCreate(Bundle savedInstanceState) {
        SplashScreen.show(this, R.style.SplashScreenTheme);  // here

        super.onCreate(savedInstanceState);

        String[] strs = {
                android.Manifest.permission.READ_EXTERNAL_STORAGE, Manifest.permission.WRITE_EXTERNAL_STORAGE,
                Manifest.permission_group.CAMERA,Manifest.permission_group.PHONE
        };
        PermissionsManager.getInstance().requestPermissionsIfNecessaryForResult(MainActivity.this, strs,
                new PermissionsResultAction() {
                    @Override
                    public void onGranted() {

                    }

                    @Override
                    public void onDenied(String permission) {

                    }
                });

//        // FIXME: 2019/9/12
//        HMSPushHelper.getInstance().connectHMS(this);

    }

    /**
     * Returns the name of the main component registered from JavaScript.
     * This is used to schedule rendering of the component.
     */
    @Override
    protected String getMainComponentName() {
        return "rnapp";
    }

    @Override
    protected void onResume() {
        super.onResume();
    }

    @Override
    protected void onPause() {
        super.onPause();
    }

}
